const mongoose = require("mongoose")
const { getNowTime } = require("../utils/tools")

const PermissionType = new mongoose.Schema({
    parentid: String,
    type: { type: String, default: "button", required: true },
    name: { type: String, required: true },
    sort: Number,
    permission: String,
    createTiem: {
        type: String,
        set() {
            return getNowTime()
        },
        default: getNowTime(),
        required: true
    },
})




const schema = mongoose.Schema(PermissionType)

const PermissionModel = mongoose.model("Permission", schema)

module.exports = PermissionModel